﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="FoodList.aspx.vb" Inherits="Week3Wscc.HotelList" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   
       <h2>
        Showing All Listings<br /> 
    </h2>

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>

    <asp:Accordion
    ID="Accordion0"
    runat="Server"
    SelectedIndex="0"
    HeaderCssClass="accordionHeader"
    HeaderSelectedCssClass="accordionHeaderSelected"
    ContentCssClass="accordionContent"
    AutoSize="None"
    FadeTransitions="true"
    TransitionDuration="250"
    FramesPerSecond="40"
    RequireOpenedPane="false"
    SuppressHeaderPostbacks="true">
    <Panes>
                <asp:AccordionPane ID="AccordionPane1" runat="server">
            <Header><img src="/pictures/misc/tags_icon.png" /> Tags</Header>

   <Content>
           <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource2" HorizontalAlign="Center" RepeatDirection="Horizontal">
            <ItemTemplate>
             
              <asp:HyperLink Runat="server" NavigateUrl ='<%#"FoodByTag.aspx?Tag=" + DataBinder.Eval(Container.DataItem, "Tag").ToString()%>' ID="Hyperlink2">
          <%# DataBinder.Eval(Container.DataItem, "Tag")%>


                            </asp:HyperLink>    
                <br />
                <br />


            </ItemTemplate>
        </asp:DataList>
                   
            </Content>
        </asp:AccordionPane>            
    </Panes>            

</asp:Accordion>


    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FoodConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FoodConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Tag] FROM [tags]">
        </asp:SqlDataSource>
    </p>
            <br />
        <p align="center">
    <b>Click on one of the pictures to access the detailed view of the offer!</b>
    </p>
    <p>

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4" DataSourceID="SqlDataSource1" HorizontalAlign="Center">
            <Columns>
                <asp:BoundField DataField="FoodName" HeaderText="Food Name" 
                    SortExpression="FoodName" />
                <asp:BoundField DataField="FoodBrand" HeaderText="Brand" 
                    SortExpression="FoodBrand" />
                <asp:BoundField DataField="FoodSize" HeaderText="Size" 
                    SortExpression="FoodSize" />
                <asp:BoundField DataField="FoodDescription" 
                    HeaderText="Description" 
                    SortExpression="FoodDescription" />
                <asp:BoundField DataField="FoodBestBefore" HeaderText="Best-Before Date" 
                    SortExpression="FoodBestBefore" />

                <asp:TemplateField>
                <ItemTemplate>
                <a href="FoodDetail.aspx?ID=<%#Eval("ID") %>">
                <img src="<%#Eval("FoodPicture")%>" style="width:200px;height:150px" align="middle" /></a>
                </ItemTemplate>
                </asp:TemplateField>

                 <asp:TemplateField HeaderText="User">
                <ItemTemplate>
                <a href='Profile.aspx?FoodUser=<%# Eval("FoodUser") %>'><%# Eval("FoodUser") %>
                </a>
                </ItemTemplate>
                </asp:TemplateField>

            </Columns>
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#5078B3" Font-Bold="True" ForeColor="#FFFFCC" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <SortedAscendingCellStyle BackColor="#FEFCEB" />
            <SortedAscendingHeaderStyle BackColor="#AF0101" />
            <SortedDescendingCellStyle BackColor="#F6F0C0" />
            <SortedDescendingHeaderStyle BackColor="#7E0000" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FoodConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FoodConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM [food]"></asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    <p>
    </p>
    <p>
    </p>
    <p>
    </p>
</asp:Content>
